package com.ktjiaoyu.service.impl;

import com.ktjiaoyu.entity.SysRole;
import com.ktjiaoyu.mapper.SysRoleMapper;
import com.ktjiaoyu.service.SysRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import java.util.List;
@Service("sysRoleService")
public class SysRoleServiceImpl implements SysRoleService {
    @Autowired
    private SysRoleMapper sysRoleMapper;
    @Override
    public List<SysRole> findAll() {
        return sysRoleMapper.getAll();
    }

    @Override
    public SysRole getById(Long id) {
        return sysRoleMapper.getById(id);
    }

    @Override
    public boolean insert(SysRole sysRole) {
        return sysRoleMapper.insert(sysRole)>0;
    }

    @Override
    public boolean update(SysRole sysRole) {
        return sysRoleMapper.update(sysRole)>0;
    }

    @Override
    public boolean delete(Integer id) {
        return sysRoleMapper.delete(id)>0;
    }

    @Override
    public SysRole getCode(String code) {
        return sysRoleMapper.getCode(code);
    }

}
